package com.example.demo.utils;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        if (n > 999) {
            System.out.print(-1);
        } else {

            System.out.print(n % 10);
            System.out.print(n / 10 % 10);
            System.out.print(n / 100 % 10);
        }
    }
}

